<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>
        榆林科技馆内容页
    </title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="../css/main.css"/>
    <script src="../js/vue2.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <script type="text/javascript" src="js/adddate.js"></script>
</head>
<body>
<form name="form1" method="post" action="../AdminServlet?action=updateAdmin" id="form1">


    <script type="text/javascript">
        //<![CDATA[
        var theForm = document.forms['form1'];
        if (!theForm) {
            theForm = document.form1;
        }

        function __doPostBack(eventTarget, eventArgument) {
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
                theForm.__EVENTTARGET.value = eventTarget;
                theForm.__EVENTARGUMENT.value = eventArgument;
                theForm.submit();
            }
        }

        //]]>
    </script>


    <div>

        <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="6B0D22E4"/>
        <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
               value="/wEdABHmQLLdB9eQIZdYHnkaBc4s8Ds3b6Y15Lq8RAGwZ2CUHUAB4aOpml0FhQEGvmNYWtgsKBl6FFSWw4rQ6dmj0iLUEVg+vAWWaU+KXrY24yLVwbgRYFAlHDpWF84hqfyffe0UqY+EdVbcAiSYpPtCLgnm198AXLacbDNAlVjYmNu4KLH9sG0OakpKoKqzQ4e1vUngBjk0MFM+ahxhxJKvZ66Oc6ejGUf4jmXWWWd+yElG8jLO3awqjhzobdBwfE26FxoQXty8MMWdrGY/1ugMCNCB6Ax7CDalcdd5J5hctA7gZxIMFluPmS1XnjVrmew7FdvN+DvxnwFeFeJ9MIBWR693MI14W7/wgUr52WRFnWK3l1s/npKCsoxHDGdZNpcjxmfhEx0+q3MUuIbpNibjUXXK"/>
    </div>
    <!--条件检索-->
    <div class="main_box" id="vueRole">
        <div class="side_here">
            <p>
                <a href="#" title="首页"></a>当前位置 > <span>系统设置</span> > <span>
                    系统用户</span></p>
        </div>
        <div class="kong">
        </div>
        <!--公用位置导航结束-->
        <div class="cont_box">
            <p class="title_bt">
                系统用户修改</p>
            <div class="biaodan_list">
                <table class="table_biaodan" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i>用户名：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txtA_user" type="text" :value="user.aUsername" id="txtA_user" class="input"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            所属角色选择
                        </td>
                        <td class="biaodan_enter">
                            <select name="ddlA_type"
                                    onchange="javascript:setTimeout(&#39;__doPostBack(\&#39;ddlA_type\&#39;,\&#39;\&#39;)&#39;, 0)"
                                    id="ddlA_type" v-model="user.roleType">
                                <option  :value="''">--请选择---</option>
                                <option  :value="'大后台管理员'"> 大后台管理员</option>
                                <option :value="'人工出票管理员'">人工出票管理员</option>

                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i>密码：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txtA_pass" type="password" maxlength="6" id="txtA_pass" class="input"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            确认密码：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txtA_pws" type="password" maxlength="6" id="txtA_pws" class="input"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            姓名：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txtA_name" type="text" :value="user.adminName" id="txtA_name" class="input"
                                   onbeforepaste="clipboardData.setData(&#39;text&#39;,clipboardData.getData(&#39;text&#39;).replace(/[\d]/g,&#39;&#39;))"/>
                        </td>
                    </tr>
                    <tr id="Hidd" style="display:block;">
                        <td class="biaodan_name">
                            所属角色：
                        </td>
                        <td class="biaodan_enter">
                            <select name="ddlA_post" id="ddlA_post" v-model="user.roleId">
                                <option selected="selected" value="0">请选择</option>
                                <option v-for="r in roles"  :value="r.roleId">{{r.roleName}}</option>
                            </select>
                        </td>
                    </tr>

                    <tr align="center">
                        <td class="anniu1" style="width: 200px; height: 50px; display: block; margin-left: 350px;">
                            <input type="submit" name="add" value="保存" id="add" class="btn btn-secondary radius"/>
                            <input type="button"  value="重置"  onclick="reinit()" class="btn btn-default radius"/>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!--表单提交结束-->

        </div>
    </div>
</form>
</body>
<script>
    vr =new Vue({
        el : "#vueRole",
        data : {
            roles:[],
            reRoles:[],
            user:{},
            reUser : {}
        }
    });

window.onload=init();
function init() {
    axios.get("../roleServlet?action=findAll").then(res=>{
        vr.roles=res.data;
        vr.reRoles = JSON.parse(JSON.stringify(vr.roles));
        console.log(res)
    });
    axios.get("../AdminServlet?action=getSession").then(res=>{
        vr.user = res.data;
        vr.reUser = JSON.parse(JSON.stringify(vr.user));
        console.log(res)
    })
}
function reinit(){
    vr.roles = JSON.parse(JSON.stringify(vr.reRoles));
    vr.user = JSON.parse(JSON.stringify(vr.reUser));
}


</script>
</html>
